Skip to main content
POST
/
public
/
v1
/
toptimize
/
forecasting
/
campaign
[BETA] Campaign Performance Forecasts
curl --request POST \
  --url https://api.topsort.com/public/v1/toptimize/forecasting/campaign \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "campaignFormat": "listing",
  "dailyBudget": 123,
  "dateRange": {
    "startDate": "2023-12-25",
    "endDate": "2023-12-25"
  },
  "targetRoas": 123,
  "campaignType": "autobidding",
  "products": [
    {
      "id": "<string>"
    }
  ],
  "triggers": [
    {
      "type": "search",
      "value": "<string>"
    }
  ],
  "targets": [
    "ad_spend"
  ]
}
'
{
  "forecasts": {
    "impressions": {
      "forecastValue": 150000,
      "forecastIntervalMin": 142000,
      "forecastIntervalMax": 158000
    },
    "clicks": {
      "forecastValue": 12500,
      "forecastIntervalMin": 11800,
      "forecastIntervalMax": 13200
    },
    "purchases": {
      "forecastValue": 875,
      "forecastIntervalMin": 820,
      "forecastIntervalMax": 930
    },
    "sales": {
      "forecastValue": 52500,
      "forecastIntervalMin": 49000,
      "forecastIntervalMax": 56000
    },
    "adSpend": {
      "forecastValue": 10500,
      "forecastIntervalMin": 10000,
      "forecastIntervalMax": 11000
    }
  }
}

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI.

Body

application/json

Public API request model for listing campaign performance forecasting.

campaignFormat
enum<string>
required

Campaign format type. Currently only 'listing' is supported.

Available options:
listing
dailyBudget
number
required

Daily budget for the campaign

dateRange
PublicDateRange · object
required

Campaign date range

targetRoas
number
required

Target Return on Ad Spend

campaignType
enum<string>
required

Campaign type (required)

Available options:
autobidding
products
PublicProductRequest · object[]
required

List of products in the campaign (required)

Minimum array length: 1
triggers
PublicTriggerRequest · object[]

List of campaign triggers (optional, defaults to empty list)

targets
enum<string>[] | null

Optional list of target variables to forecast. If not provided, all targets will be forecasted.

Public API target variables for v2 campaign forecasts.

Available options:
ad_spend,
clicks,
impressions,
purchases,
sales

Response

Successful Response

Public API response model for v2 campaign performance forecasting.

forecasts
PublicCampaignForecastMetrics · object
required

Campaign performance forecasts